set -x

export PATH=$PATH:/usr/local/go/bin
export GO111MODULE=on
export GOPROXY=https://goproxy.cn
export CXXFLAGS="-stdlib=libstdc++" CC=/usr/bin/gcc CXX=/usr/bin/g++

vs=`cat ./inputArg/flagHelp.go| grep "app.Version"|awk -F "=" '{print $2}'|sed 's/\"//g'|sed 's/\/\/版本//g'|sed 's/ //g'`
#wget http://gitlab.greatdb.com/gt-tools/public-packge/raw/master/instantclient_11_2.tar.gz .
#export LD_LIBRARY_PATH=/usr/local/$OracleDrive:$LD_LIBRARY_PATH
wget http://172.17.120.106:8080/instantclient_11_2.tar.gz -O 11g -o log1
mv 11g 11g.tar.gz
go build -ldflags "-X 'db2s/global.Version=${vs}, Revision $(git describe --always)'" -o db2s  greatdbCheck.go
chmod +x db2s
mkdir db2s-${vs}-linux-aarch64
cp -rpf  db2s relnotes docs config-simple README.md db2s-${vs}-linux-aarch64
tar zcf db2s-${vs}-linux-aarch64.tar.gz db2s-${vs}-linux-aarch64
touch `md5sum db2s-${vs}-linux-aarch64.tar.gz|awk '{print $1}'`.md5
mkdir binary
mv oracleEnv.sh 11g.tar.gz db2s-${vs}-linux-aarch64.tar.gz *.md5 binary
